package grpc_module

import (
	"context"
	"gitee.com/kmyss/gf-ex/ysgrpc"
	"github.com/gogf/gf/v2/container/gmap"
	"github.com/gogf/gf/v2/util/gconv"
)

func newFileModule() *fileModule {
	return &fileModule{}
}

type fileModule struct {
	ysgrpc.MQBaseModule
	param *gmap.StrAnyMap

	Path string
}

func (m *fileModule) setParam(param *gmap.StrAnyMap) {
	m.param = param
	_ = gconv.Struct(param.MapStrAny(), m)
}

func (m *fileModule) Init(ctx context.Context) {
	cfg := ysgrpc.NewDefaultMQModuleCfg()
	cfg.Name = "file"
	cfg.UseUnPack = false

	m.SetCfg(cfg)

	m.MQBaseModule.Init(ctx)
}
